package com.study.design.pattern.principle.compositionaggregation;

/**
 * @Author: gongsl
 * @Date: 2025-01-12 22:42
 * @description:
 */
public class ProductDao {
    private DBConnection dbConnection;

    public void setConnection(DBConnection dbConnection) {
        this.dbConnection = dbConnection;
    }

    public void addProduct(){
        String connection = dbConnection.getConnection();
        System.out.println("使用" + connection + "增加产品");
    }
}
